设为首页收藏本站

最大的系统仿真与系统优化公益交流社区

 找回密码
 注册

QQ登录

只需一步,快速开始

查看: 14289|回复: 2

[求助] Automod Syntax 编译的一个问题

[复制链接]
发表于 2009-4-4 23:58:32 | 显示全部楼层 |阅读模式
5仿真币
想请版上的人帮我看看我这段code中的一个错误,我刚学Automod没多久,实在找不出错在什么地方了,谢谢
: e4 `: Y! s/ O, s; S! m- X/ Q- ^: O" R$ H, u) s6 H+ o. b
我的问题是,在每个P_pick的process中的while循环内,总显示错误Expecting QueuePtr or Location, but found PathPtr. 在我定义所有的attribute的时候,从来没有定义过任何QueuePtr or location or PathPtr,为什么会出现这种错误呢。 我这里面A_picks是一个30x1的array的load attribute,我想用A_i这个load attribute来读取这个array中的数值,不知道会不会有什么不妥。
; o1 O) u& F! m9 j7 D
* K2 O& {! }! ?5 J7 vbegin P_read arriving
" o/ @' F% S9 o: i    while 1=1 do begin
0 S% U9 |; }) K( L$ c% [# {) B$ a& R        read A_tote from "data.txt" with delimiter "\n"
0 }6 n$ Q- @/ r' J7 B' y( d: V        read A_time from "data.txt" with delimiter "\n"
) l" l% n! U' a* t        read A_leave from "data.txt" with delimiter "\n"
$ L1 Q8 q. ]" y( F! f) ]  M" {        read A_picks from "data.txt" with delimiter "\n"( f8 i* d% L1 A' E7 `
        set load type to A_tote7 |: t; Z$ O5 P9 u2 `2 U
        if A_tote="tote 1" then set A_induct to 1$ Q/ D, _2 M* Q5 O
        else if A_tote="tote 2" then set A_induct to 2
" W0 N; `2 ^# V6 X( V; \            else set A_induct to 3   
6 ?! L, L/ r- s        set A_i to 0
, y7 F) w1 k0 N9 ^8 I        clone 1 load to P_induction7 Z2 ?& K% _6 R. h- n1 A2 e% D
        wait for A_time sec
% m% R( R$ @; c: j    end
" y. C4 T* B3 l" c2 N1 Gend' g# ^& g7 @4 E! h
" a8 M  ^# `/ n7 V; ]6 k
begin P_induction arriving
( K4 f: a8 o3 e. U    if A_induct=1 then clone 1 load to P_pick1  a+ i6 ~9 V6 q
    else if A_induct=2 then clone 1 load to P_pick2
; O4 ~5 h5 Y, Z. }' \7 M: F$ a& H        else clone 1 load to P_pick34 \6 N6 A5 j( B0 P) C2 y' D/ ~
end
$ u& j& k- ~7 T7 y
  x: o$ E3 I+ d3 x8 nbegin P_pick1 arriving
" T0 _3 h3 i, y* ~; s, ?    set A_i to 1% g& M# y6 P9 H* q* l; S
    move into Q_induct1
( B6 @. I2 x. @/ o8 u    move into pickaisle.induct1
% o1 w9 P( D1 X& C0 X    while A_i<=30 do begin
! G/ {" z$ X/ i0 S# ~, }        travel to pickaisle.con(A_i)
$ l0 r' Q  h. g, p- K        if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec
) D8 W; K* h) t) x  P2 g        else wait for 10 sec
" D& N( h! A! |        if A_i=A_leave then send to die0 w6 b. W4 C# J4 o
        else inc A_i by 1
9 d, ]" [: O5 P% ~, Q; m0 {    end- f# U! m# t2 z$ J- |2 \, K
end
0 i; E1 f# Y) U5 {3 g
& ]/ G% `2 r  }5 t0 G) j! L9 Hbegin P_pick2 arriving: i5 Q2 @- k* [. N0 o
    set A_i to 11* C& B1 {  V  H
    move into Q_induct2
4 d* G1 Y9 V, M5 {. k% n8 v    move into pickaisle.induct29 F: E; [  D5 D
    while A_i<=30 do begin
, N3 z$ ~# ?( ^        travel to pickaisle.con(A_i)
# ~0 f$ s1 o5 Y" y  T, d0 X$ S' @        if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec" {, |6 d3 @2 [
        else wait for 10 sec* l5 B6 q+ |# T1 o, U; [3 s9 p
        if A_i=A_leave then send to die
: Z0 [+ q" ^4 F7 R8 R5 |        else inc A_i by 1
2 b) B% N% o. i) ~  V# K- p7 a$ B. y/ ~    end7 f+ I9 e0 ^2 \; i3 i9 ~( M
end
  r' @. z" }- t# {: y
# G& ]) s3 v3 T4 Z0 p  hbegin P_pick3 arriving
0 Z4 l; W" ]- [7 c3 S    set A_i to 21
5 ?' x8 t1 l4 |4 e5 X) T) H; a+ t    move into Q_induct3
$ m5 s' w$ y6 k    move into pickaisle.induct30 ?' V* y( N9 m' s6 w
    while A_i<=30 do begin
6 P- k; B. Q5 i$ H9 H/ X% F6 l        travel to pickaisle.con(A_i)! P4 l. A! Z. i& f
        if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec
! Z8 Q& E  F$ Y, y        else wait for 10 sec4 y/ h+ m  u' h) x  U* J/ X
        if A_i=A_leave then send to die
# a4 L: f  r% M6 z9 y        else inc A_i by 1
+ G2 ^% s6 \9 H    end+ R/ |( x  P6 b+ D
end

最佳答案

查看完整内容

pickaisle.induct1/2/3是个什么东东? move into后面,应该是一个station或control point,或者Queue/Container/Vehicle/Segment之类的东西。看你的报错信息,这个induct是个path么? AutoMod Editor的语法报错信息,有时候会指在下一行,必要的时候要把上下几行都看一下。 另外,你的几个P_pick是完全重复的,建议以如下方式修改,可以减少代码编写量: 1. 创建一个Process:名称为P_pick,number of Processes为3,其它按你的 ...
发表于 2009-4-4 23:58:33 | 显示全部楼层
pickaisle.induct1/2/3是个什么东东?
/ S( M  i$ H7 ~/ F1 x8 }move into后面,应该是一个station或control point,或者Queue/Container/Vehicle/Segment之类的东西。看你的报错信息,这个induct是个path么?! ]/ u9 {. C' ]; K5 a

# P$ K+ ?8 d, y/ v7 s# ZAutoMod Editor的语法报错信息,有时候会指在下一行,必要的时候要把上下几行都看一下。- j0 L7 m6 o* }4 Q9 T( i/ f
) R2 i2 S  Z- P
另外,你的几个P_pick是完全重复的,建议以如下方式修改,可以减少代码编写量:
1 K+ X1 h, q7 m/ R8 H9 e1. 创建一个Process:名称为P_pick,number of Processes为3,其它按你的需要设置;删除那几个P_pick;
, V( k+ y! r, ]7 y! Q4 l6 @2. 创建一个Queue:名称为Q_induct,number of Queues为3,其他按你的需要设置并放置;删除那几个Q_induct;
" C- \3 m( D# @0 R6 ?* ^3. 以如下方式改写P_induction和几个P_pick的arriving procedure的代码:
7 i! \8 e" n, h  {  nbegin P_induction arriving
4 [4 m: [' S/ v% t% ~    clone 1 load to P_pick(A_induct)& O+ O% f  M- y( }7 \
end最大的系
  K8 u9 T) `2 _% T# q7 q: q7 S: H& R0 |5 P9 c" g
begin P_pick arriving9 N1 a4 ?; m9 v4 B* Y) j
    set A_i to procindex * 10 + 1
9 @1 L# z: l3 {! h; Y/ {, H    move into Q_induct(procindex)4 H* W  A8 m& X
    move into pickaisle.induct(procindex)$ v+ x8 y8 @4 D# O
    /*check the type of pickaisle.induct(i), for your last problem.*/
7 E6 h) D9 U8 V2 R* U2 B$ G' p' c1 h( ^; _
    while A_i<=30 do begin
& w3 _. |& W5 s/ {; b. H        travel to pickaisle.con(A_i)$ I- [: ^4 {2 z8 P" E5 a
        if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec
, b' C7 y* V  w2 d# n  U' E        else wait for 10 sec
: z- X2 k& B5 x        if A_i=A_leave then send to die/ s! P" d) R* M2 a# D
        else inc A_i by 1: n( D) T  P4 c  B1 P/ d6 \' K' W
    end
. k, v3 R) U& Lend9 R; {2 L- g$ s7 d! ^/ F5 T9 G+ o! y, B

" H5 s+ X! H* o其中的procindex为整形,代表当前process的序号。
  p% a/ X5 z' U" v; Qstation和control point只要以数字结尾,都可以直接用作数组。如pickaisle.induct(procindex),当procindex为1的时候,和pickaisle.induct1是等同的。
发表于 2009-4-20 15:33:32 | 显示全部楼层
你的主要错误应该是在move into pickaisle.induct或者 travel to pickaisle.con这两个类型的语句中,因为你的编译说明的意思是类型混淆,你查一下报错的行数,应该就能找到问题,其他的问题慢慢调吧
您需要登录后才可以回帖 登录 | 注册

本版积分规则

QQ|Archiver|手机版|SimulWay 道于仿真   

GMT+8, 2026-6-28 09:32 , Processed in 0.012857 second(s), 14 queries .

Powered by Discuz! X3.4 Licensed

© 2001-2017 Comsenz Inc.

快速回复 返回顶部 返回列表