设为首页收藏本站

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

 找回密码
 注册

QQ登录

只需一步,快速开始

查看: 14197|回复: 2

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

[复制链接]
发表于 2009-4-4 23:58:32 | 显示全部楼层 |阅读模式
5仿真币
想请版上的人帮我看看我这段code中的一个错误,我刚学Automod没多久,实在找不出错在什么地方了,谢谢% ?/ w8 ~& k# @4 R$ R+ I7 ^

* @& B/ F, z- 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中的数值,不知道会不会有什么不妥。
7 f6 ]1 }8 x  I  Q9 N/ P  }; Z' {# l- a/ B
begin P_read arriving' ^4 M1 u$ J9 `
    while 1=1 do begin! Z1 o9 e( G- O8 i% e9 V) q: ^+ L
        read A_tote from "data.txt" with delimiter "\n"
! I: e, x1 \# s3 T6 L( Y6 f        read A_time from "data.txt" with delimiter "\n"& S& [3 o- u0 U
        read A_leave from "data.txt" with delimiter "\n"# C" U; \7 g  Y  b$ M# t- a
        read A_picks from "data.txt" with delimiter "\n"5 d1 A$ k! u9 K' Q  X' Z+ ~$ T( F
        set load type to A_tote
# ~; J0 h' C6 J: J6 q3 R        if A_tote="tote 1" then set A_induct to 1$ P+ U( _7 R8 E4 R3 G: f5 c# d# r; _9 a
        else if A_tote="tote 2" then set A_induct to 2
& U3 E- z  z' P4 O7 g& j            else set A_induct to 3   
0 g. C# z8 d" O: x" n  K        set A_i to 0
- G' V8 C, O- Q# x        clone 1 load to P_induction
* ]% A, i9 _* O9 O' C        wait for A_time sec& g# i1 ~2 o) t' T4 ~/ F5 ~
    end6 Y& s  x0 _" I
end& Z% B. `5 {( {2 H% ~
8 w8 }) I; R! p9 ?) S) J
begin P_induction arriving
6 d: N0 M1 q$ m4 U8 `    if A_induct=1 then clone 1 load to P_pick1
7 A  F) w. T0 g    else if A_induct=2 then clone 1 load to P_pick2
- K) X; [. K$ Q        else clone 1 load to P_pick3. w7 f! w' I; V' A3 Z% ?( T
end
% K+ }, ]; V2 v: ]: S
: u5 m: t/ L8 d9 C* h3 e( W5 jbegin P_pick1 arriving: m7 o. n( s# D5 `6 i) y+ q) e
    set A_i to 1
) @9 f+ I" s( I$ Z    move into Q_induct1
& M  R: Q# ]5 Y2 @6 x1 Q$ q! p, @& _1 q    move into pickaisle.induct13 X2 w+ Z: G" J
    while A_i<=30 do begin
* U3 j7 @3 [7 f. I        travel to pickaisle.con(A_i)
% j6 C9 X; L: j        if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec- W/ |' P3 |+ ~) x/ q5 u/ y
        else wait for 10 sec6 r2 L9 m& [- V; N
        if A_i=A_leave then send to die
8 @) C9 I) k$ z2 c" R0 Z1 q        else inc A_i by 1, E& X  R$ D$ @! Y% t
    end# j& @: l7 V8 c! [2 O! `; u8 \6 |
end* Q+ c- }, o/ }

8 F6 S& ^0 l7 dbegin P_pick2 arriving
, E% P4 C+ q: l    set A_i to 11
7 P; u* ]6 x+ Z1 k1 W+ T    move into Q_induct2
/ V: W/ R8 d( ?- z( q" O4 a4 n# p    move into pickaisle.induct2
6 V# O2 ?  ?# S3 W7 B    while A_i<=30 do begin
/ [' k  w4 w  `8 _        travel to pickaisle.con(A_i)
0 P, k% S% ]& K8 r" i        if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec
$ g) u! [/ h% F        else wait for 10 sec
8 g- o$ p# U. m) L0 ~$ q7 P+ d# W        if A_i=A_leave then send to die% V4 A. h4 u" U+ S& X# I
        else inc A_i by 1* }# a" H: o6 y% ?. {. {$ m9 ^
    end
% n, w8 u5 o% Z5 Q3 Vend
& ?! W' ^6 v7 _" C, E, _7 }6 O- d6 p" P  |
begin P_pick3 arriving
8 o( R( r# ?$ m6 @  X% D4 R5 }; D    set A_i to 21
( e; m0 d( M( k/ K  k6 i9 l    move into Q_induct3
1 d) z4 Z8 n7 P  b2 u: u2 R    move into pickaisle.induct3
1 e: W5 ?- _: K" B    while A_i<=30 do begin* j7 ^" V0 M1 L5 S; i
        travel to pickaisle.con(A_i)
: x* I1 I' ~: S( z% M/ o. {        if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec' [2 U: A1 K- W, d
        else wait for 10 sec
* ~5 a2 F2 P2 l" G, W        if A_i=A_leave then send to die2 u5 x2 r* x) [$ I4 v) H
        else inc A_i by 1
" z8 b# t7 b; }$ b    end  ~+ C  Z$ [4 `2 }9 o
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是个什么东东?
( L+ `" {* H/ V4 ]- gmove into后面,应该是一个station或control point,或者Queue/Container/Vehicle/Segment之类的东西。看你的报错信息,这个induct是个path么?
6 J6 B8 \' O9 j% P* ^7 y7 M/ q9 ]' W# C& J- Z1 d7 X4 V
AutoMod Editor的语法报错信息,有时候会指在下一行,必要的时候要把上下几行都看一下。9 m: R" p4 h# ]) I! S: e

' D( ?( Y7 |$ c% T, R/ E: g% L另外,你的几个P_pick是完全重复的,建议以如下方式修改,可以减少代码编写量:$ [. i, B9 h3 e' b% ~0 R
1. 创建一个Process:名称为P_pick,number of Processes为3,其它按你的需要设置;删除那几个P_pick;! F: h# _" a2 {: t
2. 创建一个Queue:名称为Q_induct,number of Queues为3,其他按你的需要设置并放置;删除那几个Q_induct;
! J0 M  U8 M1 Q" a: U. E2 v/ h3. 以如下方式改写P_induction和几个P_pick的arriving procedure的代码:. |1 R  |4 B; O& `. V- Z1 r5 E) ~
begin P_induction arriving
  q; e9 ~1 U/ R2 X  }! H    clone 1 load to P_pick(A_induct)& x: I- `  }6 L, v) D
end最大的系
  |! d4 g/ {# V0 b  q6 n% C+ V# G+ s2 v" h
begin P_pick arriving; ?; L1 Q- r* r6 ~7 D- d* z
    set A_i to procindex * 10 + 1  d6 ^3 \! l8 ]2 `
    move into Q_induct(procindex)
9 |2 v8 \( B$ N5 N. d# H% B: p    move into pickaisle.induct(procindex)! }8 ]6 V- L- k. p, v
    /*check the type of pickaisle.induct(i), for your last problem.*/& ~- {- b' {  s" N1 A# `0 Z

! i7 i7 n* H1 ?( F# w/ k    while A_i<=30 do begin( Y/ x, l) l6 I4 J3 J
        travel to pickaisle.con(A_i), b7 p! ?1 O/ q* i2 ~& ~7 Z8 ]
        if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec5 u1 v) p/ x" O$ U* u
        else wait for 10 sec
+ s5 {/ ?! H5 g7 O% [( @$ D$ n        if A_i=A_leave then send to die9 L, |8 |: ~9 M, F) g+ j# S5 ?
        else inc A_i by 17 Y7 ]/ P+ b" q0 `4 }  n
    end
0 L/ w8 N% z! k9 g0 Uend. ]  X5 {: ?" o, o' h
$ `9 F, U4 C8 c
其中的procindex为整形,代表当前process的序号。) u2 K1 n1 I! Q" ]
station和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-19 09:36 , Processed in 0.014020 second(s), 14 queries .

Powered by Discuz! X3.4 Licensed

© 2001-2017 Comsenz Inc.

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