设为首页收藏本站

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

 找回密码
 注册

QQ登录

只需一步,快速开始

查看: 14557|回复: 2

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

[复制链接]
发表于 2009-4-4 23:58:32 | 显示全部楼层 |阅读模式
5仿真币
想请版上的人帮我看看我这段code中的一个错误,我刚学Automod没多久,实在找不出错在什么地方了,谢谢! M  a5 Y/ {% k' G; L' a' J+ ~' J
  U$ p2 N/ Z" `" |# k" k
我的问题是,在每个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中的数值,不知道会不会有什么不妥。
6 V) h. H& }! q& {& O
# {7 J: Q$ t$ T2 l" G* Y: kbegin P_read arriving* M! O' Z) l4 U" ]1 c0 @9 b7 U2 m1 z
    while 1=1 do begin
( S5 E1 E) l- c0 g' J) P        read A_tote from "data.txt" with delimiter "\n"
9 g" f+ k/ p0 n- ]1 V+ y  `        read A_time from "data.txt" with delimiter "\n"$ @/ [" e- g$ M  x
        read A_leave from "data.txt" with delimiter "\n"
+ `9 b6 u, a/ H4 y        read A_picks from "data.txt" with delimiter "\n"
5 h& T- m% K3 k) D- ~. v' F        set load type to A_tote
4 _! [- c( u: T4 k; i# a1 d        if A_tote="tote 1" then set A_induct to 1. J8 s, T' x/ [8 J) H3 K4 O* j6 s
        else if A_tote="tote 2" then set A_induct to 2
. a  _' f) M2 `9 i$ k- p            else set A_induct to 3    # v$ K& k" \" \
        set A_i to 0' k4 p$ E. D( G
        clone 1 load to P_induction
+ l, b0 L2 R; z. \6 d& H        wait for A_time sec
( y0 T. `! [; P3 P  u) I$ Z. y6 o    end1 u# G% n7 w& s) B% }2 f+ M
end* b) P- E+ u! R: {9 w2 N. T
9 g1 }- ~7 ~7 d6 C9 {1 e
begin P_induction arriving
. K& f1 k# @# b1 |( x/ e! m    if A_induct=1 then clone 1 load to P_pick14 d. Z7 j3 w0 W) `
    else if A_induct=2 then clone 1 load to P_pick2; ^1 t/ N0 r1 l7 B6 G8 g0 Q
        else clone 1 load to P_pick39 s3 [0 |4 O1 }! e& ~  W
end
. S) Q0 F/ ], G$ p- o! S/ @+ {
3 n, R7 Z  D. |5 P$ V1 M9 Lbegin P_pick1 arriving
# ?" d& s9 `- M& Y& n    set A_i to 1
. D- T0 n+ H2 W    move into Q_induct1$ U* L0 i7 l4 n4 Z6 r1 O) p6 W
    move into pickaisle.induct1
& N+ R8 k6 ^3 a8 v4 J    while A_i<=30 do begin
2 ]# W+ [- k& V. N2 p. i" U        travel to pickaisle.con(A_i)3 T" y! x3 d9 q) o
        if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec4 J6 j% {- K- z; \' B' G
        else wait for 10 sec
4 k) v8 b) J  W        if A_i=A_leave then send to die# f# k( E9 r) X/ X" s
        else inc A_i by 1
4 c- v( D" e& }. i" S; I- ^& R7 b    end% g; r2 Z  c. E! E1 [& N
end2 _) f0 i- l6 C4 H' g

7 S% A1 X& W* Q/ g% Sbegin P_pick2 arriving
+ F& t. t0 ?9 t+ u' {! A1 x    set A_i to 11
8 x* `9 w  I( p4 \: t$ V" e1 a    move into Q_induct2
" w+ w8 `4 Q2 _2 q* k    move into pickaisle.induct23 E/ ?/ H9 G1 m* l. w3 C- U4 A
    while A_i<=30 do begin
. T; m( i3 _0 o6 J2 {        travel to pickaisle.con(A_i)
" y) S- `0 L+ U5 C        if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec; |' R+ ^" J1 [& f( d
        else wait for 10 sec9 i8 q7 a0 `6 y6 }- _
        if A_i=A_leave then send to die
1 y3 O( j* `/ }        else inc A_i by 1
1 S0 j* A. m+ G+ _    end$ O( o/ L5 S- u0 K% d
end
* t: i: g8 I+ \" P9 R* _- Q% s! a1 V" d
begin P_pick3 arriving- |+ N, S+ q4 ~4 G' x* s
    set A_i to 21, @5 I/ R$ S" k& q& N
    move into Q_induct3
5 K3 q7 z$ e* N; L7 j" ]* L- {    move into pickaisle.induct3) o6 N+ M7 ?2 g/ @4 n  G
    while A_i<=30 do begin: ^. G# G9 \2 [
        travel to pickaisle.con(A_i)
( {& K0 x+ r1 D. r7 @9 m        if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec
9 z# t! k" }: A' e( y        else wait for 10 sec
) L( ^& b+ O6 m8 R/ t% d7 A9 I        if A_i=A_leave then send to die
/ z' }; [+ t" Z4 D        else inc A_i by 1( a& a3 F1 q) Q8 C3 g6 I) W) @: {
    end& s) W' I/ ]6 ?! H
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是个什么东东?
  ]! V2 Q; G4 ^. umove into后面,应该是一个station或control point,或者Queue/Container/Vehicle/Segment之类的东西。看你的报错信息,这个induct是个path么?0 ^( {$ Q3 m$ K$ t

8 ]6 n, @! l- T# Y3 ]1 O$ ]1 ?5 B9 MAutoMod Editor的语法报错信息,有时候会指在下一行,必要的时候要把上下几行都看一下。
. r7 R8 k' T1 K6 }5 j' X8 @! ]# O; r
另外,你的几个P_pick是完全重复的,建议以如下方式修改,可以减少代码编写量:
9 C* l! p* T1 ?; _0 h1. 创建一个Process:名称为P_pick,number of Processes为3,其它按你的需要设置;删除那几个P_pick;
6 @  _7 h% x/ m% Q# K% u. `2. 创建一个Queue:名称为Q_induct,number of Queues为3,其他按你的需要设置并放置;删除那几个Q_induct;3 n9 Y5 l( z! H/ D% @
3. 以如下方式改写P_induction和几个P_pick的arriving procedure的代码:
6 H) ]5 g' o3 D! J+ }; J! lbegin P_induction arriving
: p/ p  J0 e: \+ H9 v9 a    clone 1 load to P_pick(A_induct)
; J; [- r- g$ E) ^) ]end最大的系. F7 B% g  n) V6 q& e) f
4 D6 Q+ G7 z( N: }: u6 @
begin P_pick arriving3 u* |: @: b, P& U, I) ~% b
    set A_i to procindex * 10 + 1, h- ^! e2 ^. \
    move into Q_induct(procindex)9 z3 p! L  a; C8 g
    move into pickaisle.induct(procindex)3 f8 p; f" G- u, g, Z
    /*check the type of pickaisle.induct(i), for your last problem.*/* A8 R; @: l  c9 u, [
  ?6 I$ B# ^/ D4 \, w+ }9 U
    while A_i<=30 do begin
; ^1 l9 J0 i+ S# D9 s# s; t4 {        travel to pickaisle.con(A_i)
  y2 D, q6 V, S" Q2 B5 x, Z7 V        if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec
/ F+ f2 g( Q6 G& k8 n        else wait for 10 sec
3 y& _5 y# j& ~4 R        if A_i=A_leave then send to die
; ?. T7 v+ c# `        else inc A_i by 1! T. q6 z# ?: a) J
    end+ N6 B+ Q+ v+ H5 M+ a( ^
end* X' V# j7 U$ \

6 b5 \8 J0 ^! \  w, P6 K8 g& X其中的procindex为整形,代表当前process的序号。
& R" ~$ _7 \+ P  |. ]) tstation和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-7-16 22:23 , Processed in 0.019667 second(s), 14 queries .

Powered by Discuz! X3.4 Licensed

© 2001-2017 Comsenz Inc.

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