设为首页收藏本站

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

 找回密码
 注册

QQ登录

只需一步,快速开始

查看: 12835|回复: 2

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

[复制链接]
发表于 2009-4-4 23:58:32 | 显示全部楼层 |阅读模式
5仿真币
想请版上的人帮我看看我这段code中的一个错误,我刚学Automod没多久,实在找不出错在什么地方了,谢谢- q! ~; f5 j3 u  ?6 L3 t

7 t0 b' i7 O' R; D% R我的问题是,在每个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中的数值,不知道会不会有什么不妥。! N4 ?/ m+ n9 s" h6 T* w$ y
$ k$ X* s) ~, `6 U
begin P_read arriving0 `" W9 m  c; D! @' ]) }* F% I
    while 1=1 do begin
! R) S9 Q& o2 x        read A_tote from "data.txt" with delimiter "\n"
' `7 }* q' o1 p, H, e/ [. [, {        read A_time from "data.txt" with delimiter "\n"; u* D- R  p, G( d7 T; I& t! |* ]
        read A_leave from "data.txt" with delimiter "\n"
- D9 ?( ]7 _' Z1 w9 l        read A_picks from "data.txt" with delimiter "\n"
3 L! p# C) F6 O8 ]        set load type to A_tote- D3 P# W& j7 v% n) k
        if A_tote="tote 1" then set A_induct to 1/ p: L0 C8 P8 z
        else if A_tote="tote 2" then set A_induct to 2. O4 G* Y' S( U0 L
            else set A_induct to 3   
: h/ O/ R$ _6 z* S$ F        set A_i to 0$ I5 d, A1 L7 |' R/ \6 }  K4 y
        clone 1 load to P_induction
& O! s8 A- D: g1 C6 Y        wait for A_time sec- _' J3 X4 d$ F
    end
/ O; n6 A! f/ N0 S: p9 v3 M" X' I2 Lend
% r3 z3 j& V( C7 ^+ K2 ]6 f) K5 Q9 @
begin P_induction arriving
6 ~" v% i7 O4 b5 {    if A_induct=1 then clone 1 load to P_pick13 S! P% s/ o0 D6 D# Y2 }
    else if A_induct=2 then clone 1 load to P_pick2. v; r& V4 G! m. ~3 b
        else clone 1 load to P_pick3
3 a# V: E( r2 d/ p4 g' ~end- h' v$ g) b( K
- `# h3 }" Q% b! n$ q0 }- q* f
begin P_pick1 arriving
% D4 n) a* o' Z8 [% e- E0 J# e    set A_i to 1# R9 h4 _2 m* j! W. Z' B
    move into Q_induct1
- `2 J$ H/ H- p; E0 K: Z( f# ~    move into pickaisle.induct18 o: v6 I" e, w' d! c! b
    while A_i<=30 do begin; J! V! s: @  ]1 J- i
        travel to pickaisle.con(A_i)
% S2 Y- }3 g: j2 ~7 j3 c        if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec
' R  [$ s: F: s" z# a        else wait for 10 sec- n: J8 `. ?# r# V4 r* i
        if A_i=A_leave then send to die3 o7 M1 v* C) A  [2 K  n
        else inc A_i by 1
& B0 {3 q) A- G% p5 C# E! _    end' K( Y3 m; B/ D/ G/ E' }$ n  M" {+ q' Y
end
9 Y( G  A2 c- |! ]. e+ [- \7 h  s# J
begin P_pick2 arriving- ?8 A7 R  C9 w: b9 X# D' J
    set A_i to 11; u# q) _0 \8 Y* T+ b
    move into Q_induct2$ m* G- r$ q: `& t2 W
    move into pickaisle.induct2- k2 b6 L1 a& I. i1 H1 Q
    while A_i<=30 do begin$ {0 ?5 n$ y! a
        travel to pickaisle.con(A_i)* n7 b+ ~6 V. P$ s$ `# c8 k
        if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec+ _. G( K0 I1 G, E& D0 {' _
        else wait for 10 sec9 a. L" S7 {4 ~2 D  F
        if A_i=A_leave then send to die6 N0 B3 `9 l9 e; q$ Q  ~
        else inc A_i by 1
7 y) ]( Z! r9 o* W6 m    end5 U2 U! r0 _4 T, v) Z
end
% O3 Q  A  S0 K/ V3 B) Q5 [: ]2 K0 i
begin P_pick3 arriving
, M7 S. ]7 f$ u! y    set A_i to 21
- J& g! T- e8 S( f' D: a3 w8 F    move into Q_induct3* S# R' {  i. c) D1 T: u5 D
    move into pickaisle.induct3: T- Z4 j- a: D- G" ^" N) M
    while A_i<=30 do begin
- U( J2 q6 J6 R& L, ^+ Y' l, e        travel to pickaisle.con(A_i)" l% G* W0 E, U
        if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec
0 @2 E; j$ N! t% q9 d: }        else wait for 10 sec, u  J/ W# a, w9 q' I5 L) @2 x
        if A_i=A_leave then send to die
4 g+ C2 H/ ]7 y6 S6 P9 a# G        else inc A_i by 1* G& V5 A+ |9 K. \% u
    end
# P' p) j0 c+ v0 K: [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是个什么东东?
4 Y9 u' @. d8 ^1 X4 F$ {move into后面,应该是一个station或control point,或者Queue/Container/Vehicle/Segment之类的东西。看你的报错信息,这个induct是个path么?
. v7 l5 ]2 i+ q: `& C2 k' l2 N7 B" b- q+ x; I6 v) L) @' J
AutoMod Editor的语法报错信息,有时候会指在下一行,必要的时候要把上下几行都看一下。
. a" r4 n% |% |2 @& V9 d, j$ B- b4 g! @( ^& D6 l/ @( `! K
另外,你的几个P_pick是完全重复的,建议以如下方式修改,可以减少代码编写量:' I6 S8 S9 C) h/ V: T0 r
1. 创建一个Process:名称为P_pick,number of Processes为3,其它按你的需要设置;删除那几个P_pick;
# y1 }! N/ l$ E8 r2. 创建一个Queue:名称为Q_induct,number of Queues为3,其他按你的需要设置并放置;删除那几个Q_induct;
9 }, e( B' J1 {) Y3 s3. 以如下方式改写P_induction和几个P_pick的arriving procedure的代码:
! }$ S" V  F; [, }1 F' _! Lbegin P_induction arriving
! E8 O5 v: L/ x2 s( v5 }0 p' F    clone 1 load to P_pick(A_induct)
4 @3 b# H% y: \2 Y  K( Oend最大的系
; ]6 h" S( }. ~, ^9 z, L
+ u6 \1 j* I  |$ g$ X6 cbegin P_pick arriving
% X  W* o* A: |4 m6 @    set A_i to procindex * 10 + 1, w; ^/ `7 f* V5 Z% g+ r% K
    move into Q_induct(procindex)
3 ]* y! m% r, s* s2 d    move into pickaisle.induct(procindex)
+ r& f  T; f' K% B+ b! N- [    /*check the type of pickaisle.induct(i), for your last problem.*/6 v+ B- E$ k$ @. I% N

0 l* t- ^3 P" y2 i& S    while A_i<=30 do begin( C; E' u. C3 R% J
        travel to pickaisle.con(A_i)
* ^) y' L& Y2 T" E0 Q( Y6 e        if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec" X! v  @* Y; G6 z( v7 o% x' h
        else wait for 10 sec4 V1 M; @+ W3 o5 X( Y: i8 H8 m
        if A_i=A_leave then send to die
4 H) X: u" M3 b% C% U! T/ _        else inc A_i by 1& V7 v1 @9 i8 W% a  `. M
    end+ g; S3 U8 m3 s: u) E' ]) w7 W
end, G& O% [& }, ~, D3 }7 K. K
& t3 X& [5 {! i! K& D0 w( e' u/ b
其中的procindex为整形,代表当前process的序号。
6 a/ [2 o, `4 }1 ?! t2 ^2 ^4 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-2-23 12:45 , Processed in 0.018140 second(s), 14 queries .

Powered by Discuz! X3.4 Licensed

© 2001-2017 Comsenz Inc.

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